const hasPermission = {
  install(Vue, options) {
    Vue.directive('ButtonPerm', {
      inserted(el, binding, vnode) {
        // let permissionList = vnode.context.$route.meta.permission;
        let permissionList = JSON.parse(sessionStorage.getItem('loginData')).authority.SAFETY;
        if (permissionList && permissionList.length && permissionList.includes(binding.value)) {
          return true;
        } else {
          el.parentNode.removeChild(el);
        }
      }
    });
  }
};
export default hasPermission;
